"""WebForum URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from forum import views
from django.urls import include, path
import debug_toolbar

urlpatterns = [
    # 调试信息
    # path("__debug__/", include(debug_toolbar.urls)),
    # 管理员页面
    # path("admin/", admin.site.urls),
    # 自定义url
    path("", views.show_index, name='home'),
    path("user_login/", views.show_login, name='user_login'),
    path("user_logout/", views.show_logout),
    path("register/", views.show_register),
    path('<int:userID>/', views.show_userInfo, name='show_userInfo'),
    path('<int:userID>/edit/', views.show_edit),
    path('image/code/', views.image_code),
    path('post/', views.post_list),
    path('post/new/', views.post_create),

    # 点赞
    path('like/<int:userID>/<int:postID>/', views.add_like, name='add_like'),
    # 评论
    path('add/comment/<int:userID>/<int:postID>/', views.add_comment, name='add_comment'),
    # 回复
    path('add/reply/<int:userID>/<int:commentID>/', views.add_reply, name='add_reply'),
    # 帖子详情
    path('show/post/<int:postID>/info/', views.show_post_one, name='show_post_one'),
    # 评论详情
    path('show/comment/<int:commentID>/info/', views.show_comment_one, name='show_comment_one'),

    path("admin/login/", views.login),
    path('admin/', views.admin),
    path('admin/logout/', views.logout),
    path('admin/del_post/', views.del_post),
    path("admin/user_add/", views.user_add),
    path("admin/user_control/", views.user_control),

]
